<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>布局示例</title>
  <style>
    .container {
      width: 400px;
      height: 300px; 
      border: 3px solid #000;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 10px 0;
    }
    .row {
      display: flex;
      width: 90%;
      margin: 5px 0;
    }
    .box {
      width: 40px;
      height: 40px;
      background-color: pink;
      border: 2px solid #d3d3d3;
      margin: 0 10px;
    }
    .top {
      justify-content: space-around; 
    }
    .middle {
      justify-content: flex-start; 
      padding-left: 0%;
      align-items: center; 
      height: 80px; 
    }
    .bottom {
      justify-content: flex-end; 
      padding-right: 0%;
      align-items: flex-end;
      height: 80px;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="row top">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
    <div class="row middle">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
    <div class="row bottom">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
  </div>
</body>
</html>